package biolabs.query;

import java.math.BigDecimal;

/**
 * Predicate that compares two expressions as numbers and evaluates
 * to {@code true} if the first number is less than the second one,
 * and to {@code false} if <ul>
 *  <li>the first number is not less than the second one; or</li>
 *  <li>either of the expressions does not evaluate to a numeric value.</li>
 * </ul>
 *
 * @author Tomas Mikula
 */
public class LessThan extends NumericPredicate {

	public LessThan(Expression a, Expression b) {
		super(a, b);
	}

	@Override
	public boolean evalNumbers(BigDecimal a, BigDecimal b) {
		return a.compareTo(b) < 0;
	}

}
